﻿<Frame x:Class="StockManagement.Views.NewMaterial"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:System="clr-namespace:System;assembly=mscorlib"
       xmlns:helper="clr-namespace:StockManagement.Helper">
    <Frame.Content>
        <Grid x:Name="_gridNewMaterial" >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="*"></ColumnDefinition>
            </Grid.ColumnDefinitions>

            <TextBlock Margin="3"  HorizontalAlignment="Left" VerticalAlignment="Center" Text="Material Name" Height="23" Padding="3"></TextBlock>
            <TextBox Grid.Row="0" Grid.Column="1" MinWidth="150" Margin="3" Text="{Binding Path=NewMaterialName, UpdateSourceTrigger=LostFocus}" Padding="3" VerticalAlignment="Center" VerticalContentAlignment="Center" HorizontalContentAlignment="Stretch"></TextBox>

            <TextBlock Margin="3" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" Text="Material Code" Height="23" Padding="3"></TextBlock>
            <TextBox Grid.Row="1" Grid.Column="1" MinWidth="150" Margin="3" Text="{Binding Path=MaterialCode, UpdateSourceTrigger=PropertyChanged}" Padding="3" VerticalAlignment="Center" VerticalContentAlignment="Center" HorizontalContentAlignment="Stretch"></TextBox>

            <TextBlock Margin="3" Grid.Row="2"  HorizontalAlignment="Left" VerticalAlignment="Center" Height="23" Padding="3">Type of Material</TextBlock>
            <ComboBox Grid.Row="2" Grid.Column="1" IsEditable="False" MinWidth="150" Margin="3" ItemsSource="{Binding Source={StaticResource materialType}}" SelectedItem="{Binding Path=MaterialType}" Padding="3" VerticalAlignment="Center" VerticalContentAlignment="Center" HorizontalAlignment="Left">
            </ComboBox>
            <StackPanel x:Name="stckPnlButtons" Grid.Row="3" Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right">
                <Button Command="{Binding Path=AddNewCommand}">Add Material</Button>
                <Button Command="{Binding Path=DiscardCommand}" IsEnabled="True">Discard Changes</Button>
            </StackPanel>
        </Grid>

    </Frame.Content>
</Frame>
